﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MaxAndMInNumber
{
    class MaxAndMInNumber
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Write two integer numbers:");
            Console.Write("a= ");
            int a = Convert.ToInt32(Console.ReadLine());
            Console.Write("b= ");
            int b = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Greater number is {0}",(a+b + Math.Abs(a-b))/2);
            Console.WriteLine("Smaller number is {0}",(a+b - Math.Abs(a-b))/2);
            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.Magenta;
            Console.WriteLine("Second way");
            Console.WriteLine("Greater number is {0}", Math.Max(a, b));

            Console.WriteLine("Smaller number is {0}", Math.Min(a, b));
            Console.WriteLine();
        }
    }
}
